﻿using System;
using System.Collections.Generic;
using System.Text;

namespace UltiCoreLibrary
{

    public class Game
    {

        public Game(LinkedList<BasicGame> subGames, GameColor trump)
        {
            foreach (BasicGame subGame in subGames)
            {
                this.subGames.Add(subGame, null);
            }
            this.trump = trump;
        }

        private Dictionary<BasicGame, ContraLevel> subGames = new Dictionary<BasicGame,ContraLevel>();

        public Dictionary<BasicGame, ContraLevel> SubGames
        {
            get { return subGames; }
            set { subGames = value; }
        } 

        public int Value
        {
            get
            {
                int rval = 0;
                foreach (BasicGame game in subGames.Keys)
                {
                    rval += game.Value;
                }
                return rval;
            }
        }

        public String Name
        {
            get 
            {
                string rval = "";
                foreach (BasicGame basicGame in subGames.Keys)
                {
                    rval = rval + basicGame.Name + " ";
                }
                if (trump.Color == GameColors.COLOR_HEARTS)
                {
                    rval = "Hearts " + rval;
                }
                return rval;
            }
            // set { name = value; }
        }
        private GameColor trump;

        public GameColor Trump
        {
            get { return trump; }
            set { trump = value; }
        }
    }
}
